﻿Public Class Leccion

    Private lec As clsLeccion

    Public Sub Inicializa(ByVal lec As clsLeccion, ByVal pathLeccion As String)
        Me.lec = lec
        Me.DataContext = lec

        If pathLeccion IsNot Nothing Then
            Dim iniciUnit As Integer = pathLeccion.IndexOf("Unit")
            If iniciUnit > 0 Then
                Dim unit As String = pathLeccion(iniciUnit + 5)
                If IsNumeric(pathLeccion(iniciUnit + 6)) Then
                    unit = unit & pathLeccion(iniciUnit + 6)
                End If

                lec.Volumen = unit
            End If
        End If

    End Sub

    Private Sub Leccion_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded
        Me.cbTipoEjer.Focus()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button1.Click
        Me.Close()
    End Sub

    
End Class
